﻿<%@ Page Title="Admin Rediger Bruger" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="adminUsersEdit.aspx.cs" Inherits="UCNKompetenceBors.Admin.adminUsersEdit" %>

<%@ Register Assembly="CKEditor.NET" Namespace="CKEditor.NET" TagPrefix="CKEditor" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">

     <script language="javascript">
         function Hide() {
             document.getElementById('<%=lblConfirmUpdatedUser.ClientID %>').style.display = 'none';
            return false;
        }
    </script>

    <div id="adminWrapper" class="contentSmallWrapper floatLeft">
        <div id="adminSubMenuBox" class="submenuBox floatLeft">
            <div class="subMenuBoxContent">
                <ul>
                    <li>
                        <asp:HyperLink ID="hyLinkAdminDashboard" runat="server" Text="Admin Dashboard"></asp:HyperLink></li>
                    <li>
                        <asp:HyperLink ID="hyLinkUserHandling" runat="server" Text="Brugerhåndtering" ForeColor="#FF9933"></asp:HyperLink>
                        <ul>
                            <li>
                                <asp:HyperLink ID="hyLinkCreateUser" runat="server" Text="Opret Bruger"></asp:HyperLink>
                            </li>
                        </ul>
                    </li>
                    <li>
                        <asp:HyperLink ID="hyLinkAdminExchange" runat="server" Text="Køb og Salg"></asp:HyperLink></li>
                    <li>
                        <asp:HyperLink ID="hyLinkNewsHandling" runat="server" Text="Nyhedshåndtering"></asp:HyperLink></li>
                    <li>
                        <asp:HyperLink ID="hyLinkEditInformation" runat="server" Text="Ret Information"></asp:HyperLink></li>
                    <li><asp:HyperLink ID="hyLinkContactPerson" runat="server" Text="kontaktpersoner"></asp:HyperLink></li>
                    <li><asp:HyperLink ID="hylinkDepartment" runat="server" Text="Afdelinger"></asp:HyperLink></li>
                    <li>
                        <asp:HyperLink ID="hyLinkResetUsers" runat="server" Text="Reset Brugere"></asp:HyperLink></li>
                </ul>
            </div>
        </div>

        <div id="adminContentBox" class="contentBoxSmall floatLeft">
            <div id="adminContentBoxContent" class="floatLeft">
                <div class="inputFormSmall floatLeft">
                    <div class="inputFormSmallLeft floatLeft">
                        <div class="inputFormSmallRow floatLeft">
                            <asp:Label ID="lblAdminUsersEditHeader" runat="server" Text="Redigér Bruger" CssClass="contentTitle"></asp:Label>
                        </div>
                        <div class="inputFormSmallRow floatLeft">
                            <div class="inputFormSmallCellLeft floatLeft">
                                <asp:Label ID="lblUserName" runat="server" Text="Brugernavn: "></asp:Label>
                            </div>
                            <div class="inputFormSmallCellRight floatRight">
                                <asp:Label ID="lblEditUserName" runat="server"></asp:Label>
                            </div>
                        </div>

                        <div class="inputFormSmallRow floatLeft">
                            <div class="inputFormSmallCellLeft floatLeft">
                                <asp:Label ID="lblEditUserRole" runat="server" Text="Rolle: "></asp:Label>
                            </div>
                            <div class="inputFormSmallCellRight floatRight">
                                <asp:DropDownList ID="ddlEditUserRole" runat="server">

                                </asp:DropDownList>
                                <asp:RequiredFieldValidator ID="rfvalEditUserRole" runat="server" ErrorMessage="Rolle skal vælges" ToolTip="Rolle skal vælges" Text="*" ForeColor="Red" ValidationGroup="EditUser" ControlToValidate="ddlEditUserRole" InitialValue="Vælg Rolle"></asp:RequiredFieldValidator>
                            </div>
                        </div>

                        <div class="inputFormSmallRow floatLeft">
                            <div class="inputFormSmallCellLeft floatLeft">
                                <asp:Label ID="lblEditUserEmail" runat="server" Text="E-mail: "></asp:Label>
                            </div>
                            <div class="inputFormSmallCellRight floatRight">
                                <asp:TextBox ID="txtEditUserEmail" runat="server" Width="300px" MaxLength="100"></asp:TextBox>
                                <asp:RequiredFieldValidator ID="rfvalEditUserEmail" runat="server" ValidationGroup="EditUser" ErrorMessage="Email skal udfyldes" ToolTip="Email skal udfyldes" ControlToValidate="txtEditUserEmail" Display="Dynamic" Text="*" ForeColor="Red"></asp:RequiredFieldValidator>
                                <asp:RegularExpressionValidator ID="regexvalEmail" runat="server" ErrorMessage="The e-mail entered is invalid." ValidationExpression="^.+@[^\.].*\.[a-z]{2,}$" ControlToValidate="txtEditUserEmail" ValidationGroup="EditUser" ToolTip="The e-mail entered is invalid." Display="Dynamic" Text="*" ForeColor="Red"></asp:RegularExpressionValidator>
                            </div>
                        </div>

                        <div class="inputFormSmallRow floatLeft">
                            <div class="inputFormSmallCellLeft floatLeft">
                                <asp:Label ID="lblEditUserFname" runat="server" Text="Fornavn: "></asp:Label>
                            </div>
                            <div class="inputFormSmallCellRight floatRight">
                                <asp:TextBox ID="txtEditUserFname" runat="server" Width="300px" MaxLength="50"></asp:TextBox>
                                <asp:RequiredFieldValidator ID="rfvalEditUserFname" runat="server" ValidationGroup="EditUser" ErrorMessage="Fornavn skal udfyldes" ToolTip="Fornavn skal udfyldes" ControlToValidate="txtEditUserFname" Display="Dynamic" Text="*" ForeColor="Red"></asp:RequiredFieldValidator>
                            </div>
                        </div>

                        <div class="inputFormSmallRow floatLeft">
                            <div class="inputFormSmallCellLeft floatLeft">
                                <asp:Label ID="lblEditUserLname" runat="server" Text="Efternavn: "></asp:Label>
                            </div>
                            <div class="inputFormSmallCellRight floatRight">
                                <asp:TextBox ID="txtEditUserLname" runat="server" Width="300px" MaxLength="50"></asp:TextBox>
                                <asp:RequiredFieldValidator ID="rfvalEditUserLname" runat="server" ValidationGroup="EditUser" ErrorMessage="Efternavn skal udfyldes" ToolTip="Efternavn skal udfyldes" ControlToValidate="txtEditUserLname" Display="Dynamic" Text="*" ForeColor="Red"></asp:RequiredFieldValidator>
                            </div>
                        </div>

                        <div class="inputFormSmallRow floatLeft">
                            <div class="inputFormSmallCellLeft floatLeft">
                                <asp:Label ID="lblEditUserPhone" runat="server" Text="Telefon (Optional): "></asp:Label>
                            </div>
                            <div class="inputFormSmallCellRight floatRight">
                                <asp:TextBox ID="txtEditUserPhone" runat="server" Width="300px" MaxLength="15"></asp:TextBox>
                                <asp:RegularExpressionValidator ID="regexvalPhone" runat="server" ErrorMessage="The specified phone number is invalid" ToolTip="The specified phone number is invalid" ValidationGroup="EditUser" ValidationExpression="^((\(?\+45\)?)?)(\s?\d{2}\s?\d{2}\s?\d{2}\s?\d{2})$" ControlToValidate="txtEditUserPhone" Text="*" ForeColor="Red" Display="Dynamic"></asp:RegularExpressionValidator>
                            </div>
                        </div>

                        <div class="inputFormSmallRow floatLeft">
                            <div class="floatLeft">
                                <asp:Label ID="lblEditUserBio" runat="server" Text="Bio (Optional): "></asp:Label>
                                <br />
                                <br />
                                <CKEditor:CKEditorControl ID="ckeditorEditUserBio" BasePath="/ckeditor/" runat="server"></CKEditor:CKEditorControl>
                            </div>
                        </div>

                        <div class="inputFormSmallRow floatLeft">
                            <div class="floatLeft">
                                <asp:Label ID="lblConfirmUpdatedUser" runat="server"></asp:Label>
                            </div>
                            <div class="inputFormButtonMargin floatRight">
                                <asp:Button ID="btnEditUserCancel" runat="server" Text="Fortryd" CssClass="button" OnClick="btnEditUserCancel_Click" />
                                <asp:Button ID="btnEditUserConfirm" runat="server" Text="Opdater" ValidationGroup="EditUser" CssClass="button" OnClientClick="Hide()" OnClick="btnEditUserConfirm_Click" />
                            </div>
                        </div>
                    </div>
                    <div class="inputFormSmallRight floatRight">
                        <asp:ValidationSummary ID="valsumEditUser" runat="server" ForeColor="Red" HeaderText="The following errors were detected:" ValidationGroup="EditUser" />
                    </div>
                </div>
            </div>
        </div>
    </div>
</asp:Content>
